
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, a[N], b[N], q;
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; ++i)
    cin >> a[i];
  for (int i = 1; i <= n; ++i)
    cin >> b[i];
  long long ans = 0;
  for (int i = 1; i <= n; ++i)
    ans += min(a[i], b[i]);

  // 重要思路： 只考虑其变化，
  // for( int i=q;i>0;i--)
  while (q--) {
    char  op;
    int x, v;
    cin >> op >> x >> v;
    ans -=  min(a[x], b[x]);
    if (op == 'A')
      a[x] = v;
    else
      b[x] = v;
    ans += min(a[x], b[x]);
    cout << ans << endl;
  }
  return 0;
}